interface IPerson {
    name: string;
    age: number;
}

interface PersonConstructor {
    new (name: string, age: number): IPerson
}

function CreatePerson(ctor: PersonConstructor): IPerson {
    return new ctor('kaho', 28)
}

class Person implements IPerson {
    constructor(name: string, age: number) {
        this.name = name
        this.age = age
    }

    name!: string
    age!: number
}

const obj = CreatePerson(Person)

console.log(obj)

export {}